package com.loan.web;

import com.loan.dal.entity.InCustomerDO;
import com.loan.dal.entity.InPhoneDO;
import com.loan.service.InCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
/**
 * 注册页面
 */
@Slf4j
@Controller
public class ClientController {
    @Autowired
    private InCustomerService inCustomerService;

    /**
     * 加载页面验证手机号码页面
     * @return 页面地址
     */
    @RequestMapping("/r")
    String registry() {
        return "page/client/registry";
    }

    /**
     * 可以通过@PathVariable("") 注解将占位符中的值绑定到方法参数上
     * 大地贷款详细信息采集页
     * @return
     */
    @RequestMapping("/rd/{userId}")
    String registryDetail(@PathVariable(value = "userId") Integer userId){
        log.debug("id------> {}",userId);
        InCustomerDO inCustomerDO= inCustomerService.queryById(userId);
        if(inCustomerDO==null){
            return "redirect:/r";
        }
        return "page/continent/registrydetail";
    }

    /**
     * 通过路径获取idNo
     * @return
     */
    @RequestMapping("/r/{idNo}")
    String regPhone(@PathVariable(value = "idNo") Integer idNo){

        return "page/client/rregistry";
    }

    @RequestMapping("/rd")
    String registryDetail(){
        return "page/client/registrydetail";
    }
    /**
     * 加载页面验证手机号码页面
     * @return
     */
    @RequestMapping("/login")
    String login(){
        return "page/client/login";
    }



}